package com.blx.web;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;

public class BaseController {
	
	private static Logger logger = LoggerFactory.getLogger(BaseController.class);
	
	public String toJson(Object o){
		return JSON.toJSONString(o);
	}
	protected void print(HttpServletResponse response,String msg) {
        try {
			response.setContentType("text/html; charset=UTF-8");
			response.getWriter().print(msg);
		} catch (IOException e) {
			e.printStackTrace();
			logger.error("response print error!", e);
		}
    }
}
